from django.db import models

# Create your models here.
class Author(models.Model):
    name=models.CharField(max_length=255)
    age=models.CharField(max_length=255)
    sex=models.CharField(max_length=255)
    icon=models.CharField(max_length=255)
class Blog(models.Model):
    BTYPE=(('0','原创'),('1','盗版'),('2','CD'))
    title=models.CharField(max_length=255)
    content=models.CharField(max_length=255)
    btype=models.CharField(choices=BTYPE,max_length=20)
    createtime=models.DateTimeField(auto_now_add=True,null=True)
    updatetime=models.DateTimeField(auto_now=True,null=True)
    author=models.ForeignKey(Author,on_delete=models.CASCADE)